<?php defined('SYSPATH') or die('No direct script access.');

/**
 * @file type.php
 * @brief 
 * @author Lionel Tsai
 * @version 1.0
 * @date 2012-02-17
 */
class Model_Type extends ORM {
	protected $_table_name = 'term_taxonomy';
	protected $_primary_key = 'term_taxonomy_id';
	protected $_has_many = array(
		'posts' => array('through' => 'term_relationships', 'foreign_key' => 'type_id', 'far_key'=>'object_id'),
		'links' => array('through'=>'term_relationships', 'foreign_key'=>'type_id', 'far_key'=>'object_id')
	);
	
	protected $_belongs_to = array(
		'terms' => array('model' => 'term', 'foreign_key' => 'term_id')
	);	

}
